package js;

import java.util.Map;
import java.util.Scanner;

public class q奇怪的数 {
    static int mod = 998244353;

    public static void main(String[] args) {
        //【输入格式】
        //输入一行包含两个整数n,m ，用一个空格分隔。
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int m = scan.nextInt();
        scan.close();
        int ans = 0;
        // 初始化char[
//        下面这样不行，会超出long
//        long a = qmi(10, n - 1);
//        long en = qmi(10, n) - 1;
        char[] a = new char[n];
        char[] end =  new char[n];
        a[0] = '1';
        end[0] = '9';
        for (int i = 1; i < n; i++) {
            a[i] = '0';
            end[i] = '9';
        }

        // 判断偶数位是否为偶数，奇数位是否为奇数
        while (true) {
            int count = 0;
            //判断是否退出迭代
            for(int i = 0; i < n; i++) {
                if (a[i]=='9') {
                    count++;
                }
            }
            if(count==n) {
                break;
            }
//            if(a==10101) {
//                System.out.println(a);
//            }
            int flag = 1;
            int sum = 0;
            int index = 0;
            for (int i = a.length - 1; i >= 0; i--) {
                index = a.length - i;
                int num = a[i] - '0';
                sum += num;
                if ((index) % 2 == 0) {
                    if (num % 2 != 0) {
                        flag = 0;
                        break;
                    }
                } else {
                    if (num % 2 != 1) {
                        flag = 0;
                        break;
                    }
                }
            }
            if (flag == 1 && sum <= m) {
                ans++;
            }
            boolean plus = false;
            // a 数组加1 ，要进位
            for (int i = a.length - 1; i >= 0; i--) {
                if(plus) {
                    if (a[i] == '9') {
                        a[i] = '0';
                        plus = true;
                        continue;
                    } else {
                        a[i] = (char) (a[i] + 1);
                        break;
                    }
                }
                if (a[i] == '9') {
                    a[i] = '0';
                    plus = true;
                } else {
                    a[i] = (char) (a[i] + 1);
                    break;
                }
            }

        }

        System.out.println(ans % mod);
    }




}
